package org.robotlegs.xxl.modular.base 
{
	import flash.utils.Dictionary;
	import org.osflash.signals.ISignal;
	import org.robotlegs.core.IInjector;
	import org.robotlegs.core.IReflector;
	import org.robotlegs.xxl.base.SignalMap;
	import org.robotlegs.xxl.modular.core.IModuleContext;
	import org.robotlegs.xxl.modular.core.IModuleSignalMap;
	
	/**
	 * ...
	 * @author XXL
	 */
	public class ModuleSignalMap extends SignalMap implements IModuleSignalMap 
	{
		protected static var ModuleSignalClassMap:Dictionary = new Dictionary();
		
		protected var moduleContext:IModuleContext;
		
		public function ModuleSignalMap(moduleContext:IModuleContext, injector:IInjector, reflector:IReflector) 
		{
			this.moduleContext = moduleContext;
			super(injector, reflector);
			useSignalClassMap = ModuleSignalClassMap[moduleContext];
			if (useSignalClassMap == null)
			{
				useSignalClassMap = new Dictionary();
				ModuleSignalClassMap[moduleContext] = useSignalClassMap;
			}
		}
		
		/* INTERFACE org.robotlegs.xxl.modular.core.IModuleSignalMap */
		
		public function dispose():void 
		{
			useSignalClassMap = null;
			delete ModuleSignalClassMap[moduleContext];
			moduleContext = null;
		}
	}

}